package pl.nith.battleships.views;

import pl.nith.battleships.core.View;
import pl.nith.battleships.windows.MainWindow;

public class MainWindowView extends View
{	
	private MainWindow mainWindow;
	public MainWindow getMainWindow()
	{
		return mainWindow;
	}
	
	public MainWindowView()
	{
		createMainWindow();
	}
	
	private void createMainWindow()
	{
		if (mainWindow == null)
			mainWindow = new MainWindow();
	}
	
	public boolean isMainWindowVisible()
	{
		return mainWindow.isVisible();
	}
	
	public void hideMainWindow()
	{
		mainWindow.setVisible(false);
	}
	
	public void showMainwindow()
	{
		mainWindow.setVisible(true);
	}
	
	public void closeMainWindow()
	{
		mainWindow.setVisible(false);
		mainWindow.dispose();
	}
	
	public void updateWindowTitle(String windowTitle)
	{
		mainWindow.setTitle(windowTitle);
	}
}
